package com.ruoyi.production.service.impl.regulator;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.regulator.RegulatorTypeMapper;
import com.ruoyi.production.domain.regulator.RegulatorType;
import com.ruoyi.production.service.regulator.IRegulatorTypeService;

/**
 * 调节剂类型Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class RegulatorTypeServiceImpl implements IRegulatorTypeService
{
    @Autowired
    private RegulatorTypeMapper regulatorTypeMapper;

    /**
     * 查询调节剂类型
     *
     * @param regulatorTypeId 调节剂类型ID
     * @return 调节剂类型
     */
    @Override
    public RegulatorType selectRegulatorTypeById(Long regulatorTypeId)
    {
        return regulatorTypeMapper.selectRegulatorTypeById(regulatorTypeId);
    }

    /**
     * 查询调节剂类型列表
     *
     * @param regulatorType 调节剂类型
     * @return 调节剂类型
     */
    @Override
    public List<RegulatorType> selectRegulatorTypeList(RegulatorType regulatorType)
    {
        return regulatorTypeMapper.selectRegulatorTypeList(regulatorType);
    }

    /**
     * 新增调节剂类型
     *
     * @param regulatorType 调节剂类型
     * @return 结果
     */
    @Override
    public int insertRegulatorType(RegulatorType regulatorType)
    {
        regulatorType.setCreateTime(DateUtils.getNowDate());
        return regulatorTypeMapper.insertRegulatorType(regulatorType);
    }

    /**
     * 修改调节剂类型
     *
     * @param regulatorType 调节剂类型
     * @return 结果
     */
    @Override
    public int updateRegulatorType(RegulatorType regulatorType)
    {
        regulatorType.setUpdateTime(DateUtils.getNowDate());
        return regulatorTypeMapper.updateRegulatorType(regulatorType);
    }

    /**
     * 批量删除调节剂类型
     *
     * @param regulatorTypeIds 需要删除的调节剂类型ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorTypeByIds(Long[] regulatorTypeIds)
    {
        return regulatorTypeMapper.deleteRegulatorTypeByIds(regulatorTypeIds);
    }

    /**
     * 删除调节剂类型信息
     *
     * @param regulatorTypeId 调节剂类型ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorTypeById(Long regulatorTypeId)
    {
        return regulatorTypeMapper.deleteRegulatorTypeById(regulatorTypeId);
    }
}
